package com.lyj.datehandler.controller;

import com.lyj.datehandler.entity.TestEntity;
import com.lyj.datehandler.service.TestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 租户测试相关api
 * @author:liyajie
 * @createTime:2022/1/14 10:32
 * @version:1.0
 */
@RestController
@Slf4j
public class TestController {

    @Autowired
    TestService testService;

    /**
     * 新增test表数据
     * @author: liyajie
     * @date: 2022/1/14 10:34
     * @param
     * @return java.util.Map
     * @exception:
     * @update:
     * @updatePerson:
     **/
    @PostMapping("/addTest")
    public TestEntity addTest(@RequestBody TestEntity testEntity){
        testService.save(testEntity);
        return testEntity;
    }

    /**
     * 更新test表数据
     * @author: liyajie
     * @date: 2022/1/14 10:34
     * @param
     * @return java.util.Map
     * @exception:
     * @update:
     * @updatePerson:
     **/
    @PostMapping("/updateTest")
    public TestEntity updateTest(@RequestBody TestEntity testEntity){
        testService.updateById(testEntity);
        return testEntity;
    }

}
